Add unsaved changes popup to global settings - #3198
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds delegated change tracking for eligible global settings fields and regenerates the compiled admin JavaScript bundle without changing its public entrypoints. ChangesAdmin settings behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Jul 31, 2026 4:58p.m. | Review ↗ | |
| JavaScript | Jul 31, 2026 4:58p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
js/src/admin/admin.js (1)
11375-11377: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for the delegated settings handler.
Please test that search/license/payment-tab inputs do not set
fieldsUpdated, while ordinary inputs, selects, and textareas do; also verify that dynamically added controls are tracked.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@js/src/admin/admin.js` around lines 11375 - 11377, Add regression tests for the delegated settings handler bound to `#form_global_settings`, covering excluded search inputs, license-key inputs, and payment-section tabs leaving fieldsUpdated unchanged, while ordinary inputs, selects, and textareas set it. Also verify dynamically added matching controls trigger fieldUpdated and update fieldsUpdated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@js/src/admin/admin.js`:
- Around line 11375-11377: Add regression tests for the delegated settings
handler bound to `#form_global_settings`, covering excluded search inputs,
license-key inputs, and payment-section tabs leaving fieldsUpdated unchanged,
while ordinary inputs, selects, and textareas set it. Also verify dynamically
added matching controls trigger fieldUpdated and update fieldsUpdated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0831bc61-7288-4c01-b8c2-caddfc824614
📒 Files selected for processing (2)
js/formidable_admin.jsjs/src/admin/admin.js
|
This works pretty good. The only spot it doesn't popup is the Custom CSS tab. Should it trigger there? |
|
Thanks @garretlaxton! The custom CSS uses code mirror, so it uses special listeners. This should work now as well. |
garretlaxton
left a comment
There was a problem hiding this comment.
This works great!
The only minor suggestion I have is disabling this for the Uninstall Formidable Forms and permanently delete all data. option on the miscellaneous tab. That way, if someone misclicks, they don't accidentally save and delete all their data. But I'll leave that up to you to decide.
This adds the confirmation pop-up if you update a global setting and then try to leave without saving.
When testing, we want to make sure there aren't any non-settings inputs that trigger this (like a search).
And that it actually triggers for all unsaved global settings changes.
The pop-up contents vary from browser to browser. In Firefox it looks like this.
Summary by CodeRabbit